/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.powerhua.xsys.workflow.logic.impl;

import com.powerhua.xsys.workflow.dao.IWorkflowDao;
import com.powerhua.xsys.workflow.domain.WorkflowDefinition;
import com.powerhua.xsys.workflow.logic.IWorkflowManager;
import java.util.List;

/**
 *
 * @author yanyi.xu
 */
public class WorkflowManager implements IWorkflowManager {

    private IWorkflowDao workflowDao;

    public void setWorkflowDao(IWorkflowDao workflowDao) {
        this.workflowDao = workflowDao;
    }

    @Override
    public List<WorkflowDefinition> getAllWorkflow() {
        List<WorkflowDefinition> list = workflowDao.getAllWorkflowDefs();
        return list;
    }

    @Override
    public String saveWorkflowDefinition(WorkflowDefinition def) {
        StringBuffer result = new StringBuffer("");
        int i = workflowDao.saveWorkflowDef(def);
        result.append(i);
        return result.toString();
    }

    @Override
    public String saveWorkflowForm() {
        StringBuffer result = new StringBuffer("");
        return result.toString();
    }

    @Override
    public String setWorkflowForm() {
        StringBuffer result = new StringBuffer("");
        return result.toString();
    }

    @Override
    public String getAllWorkflowForm() {
        StringBuffer result = new StringBuffer("");
        return result.toString();
    }
}
